package com.example.dubbo.consumer;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.example.dubbo.interfacee.HelloService;

/**
 * Project:spring-boot-dubbo-consumer
 * <p>
 * Title:HelloController.java
 * <p>
 * Description:
 * <p>
 * Copyrigth:Jiang Software LTD.co Copyright (c) 2021
 * <p>
 * 
 * @version 1.0
 * @since 1.8
 * @author jiang
 * @history 2021 jiang create
 */
@Controller
public class HelloController {
	@DubboReference
	private HelloService helloService;

	@RequestMapping("/hello")
	public String hello(Model model,@RequestParam(value = "message", required = false, defaultValue = "上海欢迎您") String message) {
		System.out.println(helloService.sayHello("你好 "+message));
		model.addAttribute("retMessage",message);
		return "hello";
	}
}
